﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyOA.DAL;
using MyOA.Model;
namespace MyOA.BLL
{
    public class MessageManager
    {
        MessageService messageService=new MessageService();
        /// <summary>
        /// 根据UserId获取所有发信箱信息
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="size">查找条数</param>
        /// <param name="page">查找页数</param>
        /// <param name="isCount">是否为首次加载1、0</param>
        /// <param name="sum">首次查找返回总条数</param>
        /// <returns>返回查找集合</returns>
        
        public IList<Message> GetAllSendMessageByUserId(int userId, int size, int page, int isCount, out int sum)
        {
            return messageService.GetAllSendMessageByUserId(userId,size,page,isCount,out sum);

        }
        /// <summary>
        ///根据UserId获取所有草稿纸信息
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="size">查找条数</param>
        /// <param name="page">查找页数</param>
        /// <param name="isCount">是否为首次加载1、0</param>
        /// <param name="sum">首次查找返回总条数</param>
        /// <returns>返回查找集合</returns>
        
        public IList<Message> GetAllDraftMessageByUserId(int userId, int size, int page, int isCount, out int sum)
        {
            return messageService.GetAllDraftMessageByUserId(userId, size, page, isCount, out sum);

        }
        /// <summary>
        ///根据UserId获取所有收信箱信息
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="size">查找条数</param>
        /// <param name="page">查找页数</param>
        /// <param name="isCount">是否为首次加载1、0</param>
        /// <param name="sum">首次查找返回总条数</param>
        /// <returns>返回查找集合</returns>
       
        public IList<Message> GetAllReceiveMessageByUserId(int userId, int size, int page, int isCount, out int sum)
        {
            return messageService.GetAllReceiveMessageByUserId(userId, size, page, isCount, out sum);
        }
        /// <summary>
        /// 根据UserId获取所有已删除信息
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="size">查找条数</param>
        /// <param name="page">查找页数</param>
        /// <param name="isCount">是否为首次加载1、0</param>
        /// <param name="sum">首次查找返回总条数</param>
        /// <returns>返回查找集合</returns>
       
        public IList<Message> GetAllRecycleMessageByUserId(int userId, int size, int page, int isCount, out int sum)
        {
            return messageService.GetAllRecycleMessageByUserId(userId, size, page, isCount, out sum);
        }
         /// <summary>
        /// 根据UserId获取用户所有已读信箱信息
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="size">查找条数</param>
        /// <param name="page">查找页数</param>
        /// <param name="isCount">是否为首次加载1、0</param>
        /// <param name="sum">首次查找返回总条数</param>
        /// <returns>返回查找集合</returns>
        public IList<Message> getAllReadReceiveMessageByUserId(int userId, int size, int page, int isCount, out int sum)
        {
            return messageService.getAllReadReceiveMessageByUserId(userId, size, page, isCount, out sum);
        }
        /// <summary>
        /// 根据UserId获取用户所有未读信箱信息
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="size">查找条数</param>
        /// <param name="page">查找页数</param>
        /// <param name="isCount">是否为首次加载1、0</param>
        /// <param name="sum">首次查找返回总条数</param>
        /// <returns>返回查找集合</returns>
        public IList<Message> getAllNoReadReceiveMessageByUserId(int userId, int size, int page, int isCount, out int sum)
        {
            return messageService.getAllNoReadReceiveMessageByUserId(userId, size, page, isCount, out sum);
        }
        /// <summary>
        /// 根据messageId删除Message
        /// </summary>
        /// <param name="messageId">要删除的信息Id</param>
        /// <returns></returns>

        public int deleteMessageByMessageId(int messageId)
        {
            return messageService.deleteMessageByMessageId(messageId);
        }
         /// <summary>
        /// 根据messageId得到Message
        /// </summary>
        /// <param name="messageId">要得到的信息Id<Id/param>
        /// <returns></returns>
        public Message getMessageByMessageId(int messageId)
        {
            return messageService.getMessageByMessageId(messageId);
        }
        /// <summary>
        /// 根据messageId修改Message
        /// </summary>
        /// <param name="message">要修改的信息</param>
        /// <returns></returns>
        public int updateMessageByMessageId(Message message)
        {
            return messageService.updateMessageByMessageId(message);
        }
           /// <summary>
        /// 向表Message中插入新信息并查找该信息MessageId
        /// </summary>
        /// <param name="message"></param>
        /// <returns>新插入的messageId</returns>
        public int insertMessage(Message message)
        {
            return messageService.insertMessage(message);
        }
    }
}
